package com.sqx.modules.repairRecord.controller;


import com.sqx.common.utils.Result;
import com.sqx.modules.repairRecord.entity.RepairRecord;
import com.sqx.modules.repairRecord.service.RepairRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wuchang
 * @since 2022-12-12
 */

@RestController
@Api(value = "补费记录", tags = {"管理端-补费记录"})
@RequestMapping("/admin/repairRecord/")
public class AdminRepairRecordController {
    @Autowired
    private RepairRecordService repairRecordService;

    @ApiOperation("获取补费记录列表")
    @GetMapping("getRecordList")
    public Result getRecordList(Integer page, Integer limit, RepairRecord repairRecord) {
        return Result.success().put("data", repairRecordService.getRecordList(page, limit, repairRecord));
    }

    @ApiOperation("根据补费查询订单")
    @GetMapping("getOrderByRecord")
    public Result getOrderByRecord(Integer orderType, String orderNo) {
        return repairRecordService.getOrderByRecord(orderType, orderNo);
    }

    @ApiOperation("根据订单号查询补费记录")
    @GetMapping("getRecordByOrderNo")
    public Result getRecordByOrderNo(Integer orderType, String orderNo) {
        return Result.success().put("data", repairRecordService.getRecordByOrderNo(orderType, orderNo));
    }
}

